/**
 * Course Project for User Interface Programming I, 2011
 * Group 19
 */
package justdoit.actions;

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.ImageIcon;
import javax.swing.KeyStroke;
import justdoit.Startup;
import justdoit.controller.LanguageManager;

/**
 * 
 * @author Can
 */
public class ShowStatusBarAction extends AbstractAction {

    private boolean status;

    public ShowStatusBarAction() {
        super(LanguageManager.getString("menu.view.showStatusBar"));

        this.status = true;
        putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke("F7"));
        putValue(SELECTED_KEY, this.status);

    }

    public ShowStatusBarAction(String text) {
        super(text);
    }

    public ShowStatusBarAction(String text, ImageIcon icon) {
        super(text, icon);
    }

    public ShowStatusBarAction(String text, ImageIcon icon,
            String desc, Integer mnemonic) {
        super(text, icon);
        putValue(SHORT_DESCRIPTION, desc);
        putValue(MNEMONIC_KEY, mnemonic);
    }

    public void actionPerformed(ActionEvent e) {
        status = !status;
        Startup.getMainFrame().showStatusBar(status);
    }
}
